import http from '@/utils/request';
export default {
    /**
    * 查询权限菜单列表
    * @param params
    */
    async getMenuList(params){
        return await http.get("/api/permission/list",params);
    },

    /**
    * 获取上级菜单
    * @returns
    */
    async getParentMenuList(params) {
        return await http.get("/api/permission/parent/list", params)
    },

    /**
    * 添加菜单
    * @returns
    */
    async addMenu(params){
        return await http.post("/api/permission/save",params)
    },

    /**
    * 修改菜单
    * @returns
    */
    async updateMenu(params){
        return await http.put("/api/permission/update",params)
    },

    /**
    * 检查菜单下是否存在子菜单，或者是否被分配角色
    */
    async checkPermission(param){
        return await http.getRestApi("/api/permission/check",param);
    },
    /**
    *  修改或新增的时候，判断一下权限编码是否重复
    */
    async checkPermissionCode(param){
        return await http.getRestApi("/api/permission/checkPermissionCode",param);
    },
    /**
    * 删除菜单
    * @returns
    */
    async deleteById(params) {
        return await http.delete("/api/permission/delete", params);
    }
}